<?php
/**
 * Created by PhpStorm.
 * User: zhonghuanglin
 * Date: 02/09/2017
 * Time: 10:53
 */

namespace inframe\service\socketio;


/**
 *
 * Class Message 代表通信过程中的消息体部
 *
 * @property string $from
 * @property string $to
 * @property int $type
 * @property string $content
 *
 * @package inframe\service\socketio
 */
class Message
{
    /**
     * @var array 消息的组成部分
     */
    protected $data = [];

    public function __construct(array $info)
    {
        $this->data = $info;
    }

    public function __get($name)
    {
        return $this->data[$name] ?? null;
    }

    public function __set($name, $value)
    {
        $this->data[$name] = $value;
    }


}